package com.market.options.dao;

import java.util.List;

import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.stereotype.Component;

import com.market.options.domain.OptionsCommand;

@Component
public class OptionsDaoImpl extends SqlSessionDaoSupport implements OptionsDao{
	@Override
	public void insert(OptionsCommand options) {
		getSqlSession().insert("insertOptions", options);
	}
	
	@Override
	public void update(OptionsCommand options) {
		getSqlSession().update("updateOptions", options);		
	}
	
	@Override
	public List<OptionsCommand> list(int p_code) {
		List<OptionsCommand> list = getSqlSession().selectList("Options.selectList", p_code);
		return list;
	}
	@Override
	public void delete(int o_code) {
		System.out.println(o_code+"나오냐?");
		getSqlSession().delete("deleteOptions", o_code);		
	}	
}
